﻿@model CultuRAM.Models.Event

@{
    ViewBag.Title = "Editar Evento";
}

<h4 style=""><i class="icon-pencil"></i> Editar Evento</h4>


    <!-- INICIO DO SISTEMA DE TABS -->
    <div class="tabbable">
        <ul class="nav nav-tabs" style="margin-bottom: 10px;">
            <li class="active"><a href="#tabDad" data-toggle="tab"><i class="fa fa-align-justify"></i> Dados Gerais</a></li>
            <li><a href="#tabPro" data-toggle="tab"><i class="fa fa-list"></i> Propriedades</a></li>
            <li><a href="#tabSes" data-toggle="tab"><i class="fa fa-tags"></i> Sessões</a></li>
            <li><a href="#tabPar" data-toggle="tab"><i class="fa fa-user"></i> Artistas</a></li>
            <li><a href="#tabRes" data-toggle="tab"><i class="fa fa-tasks"></i> Recursos</a></li>
            <li><a href="#tabCom" data-toggle="tab"><i class="fa fa-comment"></i> Comentários</a></li>
        </ul>
        <div class="tab-content" style="">
            <!-- TAB DADOS GERAIS -->
            <div class="tab-pane active" id="tabDad">
            
                @*@Html.Partial("_EventGeralDataCreate", Model)*@
                <div id="tabEventGeral">

                    @Html.Partial("_EventGeralData", Model)     
                         
                </div>
            </div>
        
            <!-- TAB DAS PROPRIEDADES -->
            <div class="tab-pane" id="tabPro">
                <div id="tabEventProp" class="row-fluid">
                    <!-- Event Left -->
                    <div id="tabEventPropLeft" class="span6">  
                        @if (Model.PropertyValues == null || !Model.PropertyValues.Any())
                        {
                            <div class="alert alert-warning" style="margin-top: 10px">
                                Este evento não tem Propriedades definidas!
                            </div>@*
                            <p>@Ajax.ActionLink("Adicionar Propriedade", "CreatePv", "EventPropertyValues",new { page = 1, idEvent = Model.EventId},
                                                new AjaxOptions
                                                    {
                                                        UpdateTargetId="tabEventPropRight", 
                                                        InsertionMode = InsertionMode.Replace, 
                                                        HttpMethod = "GET", 
                                                        OnComplete = "BgColorAdd()"
                                                    }, new { @class = "btn btn-success btn-xs", id="btnAddProp" })</p>*@
                           <br/>
                            <p>@Html.Raw(@Ajax.ActionLink("replacetxt", "CreatePv", "EventPropertyValues",new { page = 1, idEvent = Model.EventId},
                                                new AjaxOptions
                                                    {
                                                        UpdateTargetId="tabEventPropRight", 
                                                        InsertionMode = InsertionMode.Replace, 
                                                        HttpMethod = "GET", 
                                                        OnComplete = "PropBgColorAdd()"
                                                    }, new { @class = "btn btn-success btn-xs", id="btnAddProp" })
                                 .ToHtmlString().Replace("replacetxt", "<i class=\"icon-plus icon-white\"></i> Adicionar Propriedade"))
                            </p>
                                
                        }
                        else
                        {
                            @Html.Partial("~/Views/EventPropertyValues/_Index.cshtml", Model.PropertyValuesPaged)
                        }
                    </div>
                    <!-- Event Right -->
                    <div id="tabEventPropRight" class="span6">
                        @Html.Partial("~/Views/EventPropertyValues/_Default.cshtml", Model)
                    </div>
                </div>
            </div>

            <!-- TAB DAS SESSOES -->
            <div class="tab-pane" id="tabSes">
                 <div id="tabEventSes" class="row-fluid">
                        <!-- Event Left -->
                     <div id="tabEventSesLeft" class="span6">  
                         @if (Model.EventSessions == null || !Model.EventSessions.Any())
                         {
                             <div class="alert alert-warning" style="margin-top: 10px">
                                 Este evento não tem Sessões definidas!
                             </div>
                             <br/>
                              <p>
                                 @Html.Raw(@Ajax.ActionLink("replacetxt", "CreatePv", "Session", new {page = 1, idEvent = Model.EventId},
                                                new AjaxOptions
                                                    {
                                                        UpdateTargetId = "tabEventSesRight",
                                                        InsertionMode = InsertionMode.Replace,
                                                        HttpMethod = "GET",
                                                        OnComplete = "SesBgColorAdd()"
                                                    }, new {@class = "btn btn-success btn-xs", id = "btnAddSes"}) 
                                 .ToHtmlString().Replace("replacetxt", "<i class=\"icon-plus icon-white\"></i> Adicionar Sessão"))           
                             </p>
                             
                         }
                         else
                         {
                             @Html.Partial("~/Views/Session/_Index.cshtml", Model.EventSessionsPaged)
                         }
                     </div>
                     <!-- Event Right -->
                     <div id="tabEventSesRight" class="span6">
                         @Html.Partial("~/Views/Session/_Default.cshtml", Model)
                     </div>
                 </div>         
            </div>

            <!-- TAB DOS PARTICIPANTES -->
            <div class="tab-pane" id="tabPar">    
                <div id="tabEventPar" class="row-fluid">
                    <!-- Event Left -->
                    <div id="tabEventParLeft" class="span6">
                        @if (Model.EventParticipants == null || !Model.EventParticipants.Any())
                        {
                            <div class="alert alert-warning" style="margin-top: 10px">
                                Este evento não tem Artistas definidos!
                            </div>
                            <br/>
                             <p>
                             @Html.Raw(@Ajax.ActionLink("replacetxt", "CreatePv", "EventParticipant", new {page = 1, idEvent = Model.EventId},
                                                        new AjaxOptions
                                                            {
                                                                UpdateTargetId = "tabEventParRight",
                                                                InsertionMode = InsertionMode.Replace,
                                                                HttpMethod = "GET",
                                                                OnComplete = "ParBgColorAdd()"
                                                            }, new {@class = "btn btn-success btn-xs", id = "btnAddPart"})
                                 .ToHtmlString().Replace("replacetxt", "<i class=\"icon-plus icon-white\"></i> Adicionar Artísta"))   
                            </p>
                            

                        }
                        else
                        {
                            @Html.Partial("~/Views/EventParticipant/_Index.cshtml", Model.EventParticipantsPaged)
                        }
                    </div>
                    <!-- Event Right -->
                    <div id="tabEventParRight" class="span6">
                        @Html.Partial("~/Views/EventParticipant/_Default.cshtml", Model)
                    </div>
                </div>
            </div>

            <!-- TAB DOS RECURSOS -->
            <div class="tab-pane" id="tabRes">
                <div id="tabEventRes" class="row-fluid">
                    <!-- Event Left -->
                    <div id="tabEventResLeft" class="span6">
                        @if (Model.Resources == null || !Model.Resources.Any())
                        {
                            <div class="alert alert-warning" style="margin-top: 10px">
                                Este evento não tem Recursos definidos!
                            </div>
                            <br/>
                            <p>
                                 @Html.Raw(@Ajax.ActionLink("replacetxt", "CreatePv", "Resource", new {page = 1, idEvent = Model.EventId},
                                                 new AjaxOptions
                                                     {
                                                         UpdateTargetId = "tabEventResRight",
                                                         InsertionMode = InsertionMode.Replace,
                                                         HttpMethod = "GET",
                                                         OnComplete = "ResBgColorAdd()"
                                                     }, new {@class = "btn btn-success btn-xs", id = "btnAddRec"}) 
                                                .ToHtmlString().Replace("replacetxt", "<i class=\"icon-plus icon-white\"></i> Adicionar Recurso")) 
                            </p>
                        }
                        else
                        {
                            @Html.Partial("~/Views/Resource/_Index.cshtml", Model.ResourcesPaged)
                        }
                    </div>
                    <!-- Event Right -->
                    <div id="tabEventResRight" class="span6">
                        @Html.Partial("~/Views/Resource/_Default.cshtml", Model)
                    </div>
                </div>
            </div>

            <!-- TAB DOS COMENTARIOS -->
            <div class="tab-pane" id="tabCom">
                <div id="tabEventCom" class="row-fluid">
                    <!-- Event Left -->
                    <div id="tabEventComLeft" class="span6">
                        @if (Model.Comments == null || !Model.Comments.Any())
                        {
                            <div class="alert alert-warning" style="margin-top: 10px">
                                Este evento não tem Comentários definidos!
                            </div>
                            
                        }
                        else
                        {
                            @Html.Partial("~/Views/Comment/_Index.cshtml", Model.CommentsPaged)
                        }
                    </div>
                    <!-- Event Right -->
                    <div id="tabEventComRight" class="span6">
                        @Html.Partial("~/Views/Comment/_Default.cshtml", Model)
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- FIM DO SISTEMA DE TABS -->

@*    <button id="btnSaveExistEvent" value="Guardar" class="btn btn-primary"> Guardar alterações do Evento </button>
    @Html.ActionLink("Cancelar alterações", "Index", null, new {@class = "btn btn-default"})*@
    <a id="btnSaveExistEvent" href="#" class = "btn btn-primary"><i class="icon-ok icon-white"></i> Guardar Alterações</a>
    <a href="@Url.Action("Index")" class = "btn btn-default"><i class="icon-ban-circle"></i> Cancelar Alterações</a>

@*}*@


@Scripts.Render("~/bundles/culturam")
